
def ack(m, n):
    if m < 0 or n < 0:
        print "error! m and n should >= 0"
        exit(3)

    if m == 0:
        return n + 1
    if n == 0:
        return ack(m - 1, 1)

    return ack(m - 1, ack(m, n - 1))


print ack(0, 4)